package co.com.tye.exceptions;

/**
 * @author Zathura Code Generator http://code.google.com/p/zathura/
 * www.zathuracode.org
 * 
 */
public class ZMessManager extends RuntimeException {
	private static final long serialVersionUID = 1L;

	public final static String ALL = "All ";
	public final static String ENTCHILD = "related tables(childs)";
	public final static String FOREIGNDATA = "foreign classes data: ";
	public static String ENTITY_SUCCESFULLYSAVED = "Registro guardado exitosamente";
	public static String ENTITY_SUCCESFULLYDELETED = "Registro Eliminado ";
	public static String ENTITY_SUCCESFULLYMODIFIED = "Registro Modificado";
	public static String ENTITY_WITHSAMEKEY = "Otra entidad posee la misma identificacion";
	public static String ENTITY_NOENTITYTOUPDATE = "Ningun Registro Encontrado ";

	public ZMessManager() {
	}

	public ZMessManager(String exception) {
		super(exception);
	}

	public class NotValidFieldException extends ZMessManager {
		private static final long serialVersionUID = 1L;

		public NotValidFieldException(String info) {
			super("El valor del campo: \"" + info + "\" no es valido");
		}
	}
	
	public class NullEntityExcepcion extends ZMessManager {
		private static final long serialVersionUID = 1L;

		public NullEntityExcepcion(String info) {
			super("El " + info + " Registro no puede ser nulo ni vacio");
		}
	}

	public class EmptyFieldException extends ZMessManager {
		private static final long serialVersionUID = 1L;

		public EmptyFieldException(String info) {
			super("El valor del campo: \"" + info
					+ "\"no puede ser nulo o vacio");
		}
	}

	public class NotValidFormatException extends ZMessManager {
		private static final long serialVersionUID = 1L;

		public NotValidFormatException(String info) {
			super("el formato o el tamaño del registro: \"" + info
					+ "\" no son validos");
		}
	}

	public class DeletingException extends ZMessManager {
		private static final long serialVersionUID = 1L;

		public DeletingException(String info) {
			super("la entidad que esta tratando de eliminar "
					+ "puede tener informacion relacionada, "
					+ "intentelo luego nuevamente, "
					+ "revise la data de la entidad, \"" + info+"\"");
		}
	}
	
	public class ForeignException extends ZMessManager {
		private static final long serialVersionUID = 1L;

		public ForeignException(String info) {
			super("There was no data related with the input \"" + info+ "\"");
		}
	}	

	public class GettingException extends ZMessManager {
		private static final long serialVersionUID = 1L;

		public GettingException(String info) {
			super("There was an exception getting " + info);
		}
	}

	public class FindingException extends ZMessManager {
		private static final long serialVersionUID = 1L;

		public FindingException(String info) {
			super("There was an exception trying to find " + info);
		}
	}

}
